<%-- 
    Document   : index
    Created on : Feb 28, 2011, 5:23:52 PM
    Author     : M Bilal
--%>

<%@page import="wap.rockvilletech.portal.DBProc"%>
<%@page import="org.apache.log4j.Logger"%>
<%@ include file="../includes/header.jspf"%>
<%
final int image_width_final = 60;
final Logger log = Logger.getLogger("Cricket.JSP.INDEX");
DBProc db=DBProc.getInstance();
String str_feed_id="59",str_feed_title="59";
int int_news_limit=3;
String _categoryList="WALLPAPERS,VIDEOS";
strAppMainCat="Cricket";
thisPage="index.jsp";
%>
<script language="javascript" type="text/javascript" src="../js/ajaxscript.js">//javascript</script>
 <div align="center" style=" background-color: #dedfe1;padding-top:2px;background-image:url('images/new/.jpg');background-repeat: repeat-x;background-position:0% 350%;">
        <a href="<%=context_Path%>"><img src='<%=context_Path%>/imgsrv?img=home<%=sImgFix%>.jpg&repo=PI&s=0&w=<%=mainButtonImgWidth%>' alt="home" title="Home"></a>
        <a href="<%=context_Path%>/content/index.jsp?app=Bollywood"><img src='<%=context_Path%>/imgsrv?img=downloads<%=sImgFix%>.jpg&repo=PI&s=0&w=<%=mainButtonImgWidth%>' alt="downloads" title="Downloads"></a>
        <a href="<%=context_Path%>/coolstuff/index.jsp"><img src='<%=context_Path%>/imgsrv?img=cool_stuff<%=sImgFix%>.jpg&repo=PI&s=0&w=<%=mainButtonImgWidth%>' alt="coolstuff" title="Cool Stuff"></a>
        <a href="<%=context_Path%>/news/news.jsp"><img src='<%=context_Path%>/imgsrv?img=news<%=sImgFix%>.jpg&repo=PI&s=0&w=<%=mainButtonImgWidth%>' alt="news" title="News"></a>
    </div>
<%
try{
	String livescore = db.getLiveScore();
	if(!"".equals(livescore)) {
	%>
		<div style="padding: 0px 0px 0px 0px;">
		<table width="100%" cellpadding="0" cellspacing="0">
		        <tr>
		            <td align="left" style="padding:5px 0px 0px 2px;">
		                <table bgcolor="#d5d5d5" border="0" cellpadding="0" cellspacing="0"><tr>
		                        <td><img src="<%=context_Path%>/images/bar_left.png" alt="" /></td>
		                        <td><b>&nbsp;Live Score&nbsp;</b></td>
		                        <td><img src="<%=context_Path%>/images/bar_right.png" alt="" /></td>
		                    </tr>
		                </table>
		            </td>
		        </tr>
		        <tr>
		            <td align="left" style="background-image:url('../images/new/catagory_top_part.jpg');background-repeat: repeat-x; padding:6px 0px 0px 0px;">
		            <div id="livescore" style="padding: 1px 5px;">
	                <%
	                if(isJSsupport){
						%><script language="javascript" type="text/javascript">getLiveScoreData('<%=width%>');</script><%
					}
                    else {
						out.println(livescore);
					}
					%>
					</div>
					<div style="text-align: right; padding-right: 5px; font-weight: bold; padding-bottom: 3px;" 
						class="more" id="more"><a href="highlights.jsp">Match Highlights</a> 
					</div>										
		            </td>
		        </tr>		         
		</table>
		</div>
    <%
	}
} catch(Exception e) {
	log.error("Live score at index.jsp",e);
}
%>
<div style="padding: 0px 0px 0px 0px;">
<table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td align="left" style="padding:5px 0px 0px 2px;">
                <table bgcolor="#d5d5d5" border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><img src="<%=context_Path%>/images/bar_left.png" alt="" /></td>
                        <td><b>&nbsp;Fixtures&nbsp;</b></td>
                        <td><img src="<%=context_Path%>/images/bar_right.png" alt="" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center" style="background-image:url('../images/new/catagory_top_part.jpg');background-repeat: repeat-x; padding:6px 0px 0px 0px;">
                <table align="center" width="100%" style="padding:0px 0px 0px 3px;">
                    <tr>
                        <td width="50%">
                            <div align="left" style="padding: 0px 0px 4px 3px;">
                               <%
                               Vector v_fixtures=wpb.get_latest_worldcup_fixtures(true,"Pakistan in West Indies");//pass true to get lastest 2 fixtures.
                               try{
                                   if(!v_fixtures.isEmpty()){
                                       %>
                               <ul style="margin: 0px; padding: 0px 0px 0px 7px; list-style-image: url('/ufone/images/bullet-grey.jpg');">
                               <%
                                       for(int i=0;i<v_fixtures.size();i++){
                                       String[] arr_fixtures=(String [])v_fixtures.get(i);
                               %>
                                
                                    <li style="padding: 0px 0px 3px;"><b><%=arr_fixtures[0]%></b><br/>
                                        <%=arr_fixtures[1]%><br/>
                                        <%=arr_fixtures[2]%> vs <%=arr_fixtures[3]%><br/>
                                        <%=arr_fixtures[4]%>
                                    </li>
                                <%}//end loop%>
                                   
                                </ul>

                                <div style="text-align: right; padding-right: 5px; font-weight: bold; padding-bottom: 3px;" class="more" id="more">
                                    <a href="fixtures.jsp" class="">more</a>
                                </div>
<%                              }else{
                                       out.println("Data Not Available.");
                                }
                               }catch(Exception e){
                                  log.error("WC2011-fixtures=INDEX.JSP",e);
                                }
%>
                            </div>
                        </td>
                    </tr>

                </table>
            </td>
        </tr>
    </table>


</div>
<div style="padding: 0px 0px 0px 0px;">
    <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td align="left" style="padding:5px 0px 0px 2px;">
                <table bgcolor="#d5d5d5" border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><img src="<%=context_Path%>/images/bar_left.png" alt="" /></td>
                        <td><b>&nbsp;News&nbsp;</b></td>
                        <td><img src="<%=context_Path%>/images/bar_right.png" alt="" /></td>
                    </tr>
                </table>
            </td>
	</tr>
	<tr>
    <td align="center" style="background-image:url('../images/new/catagory_top_part.jpg');background-repeat: repeat-x; padding:6px 0px 0px 0px;">
	<div id="NewsBlock" class="NewsBlock" style="<%=css_NewsBlock%>">
    <%
    Vector vRSSNews=db.getRSSNews(str_feed_id, int_news_limit);
	if(!vRSSNews.isEmpty()){
    	try {
        	String[] arrNews=null;
            String strImageURL="",ititle="";
            int intNewsId=0;
            boolean is_Image=false,hasImageDisplay=true;
            for (int ptr = 0; ptr < vRSSNews.size(); ptr++) {//id,channel_id,headline,imgpath,newsdate
            	try {
                	arrNews = (String[]) vRSSNews.get(ptr);
                    strImageURL = arrNews[3];
                    intNewsId = Integer.parseInt(arrNews[0]);
                    ititle = arrNews[2];
                    ititle = wap.rockvilletech.util.StringUtils.toUnicode(ititle);
                    is_Image = (!strImageURL.equals("")) && strImageURL.length() > 1 && strImageURL != null ? true : false;
                    if (is_Image && hasImageDisplay) {
				        %>
				        <a class="newsFeed" href="<%=context_Path%>/news/content.jsp?page=<%=thisPage%>&feed=<%=str_feed_id%>&newsitemid=<%=intNewsId%>&ftitle=<%=str_feed_title%>">
				        <img src="<%=context_Path%>/imgsrv?img=<%=strImageURL%>&s=0&repo=http&w=<%=image_width_final%>" alt="" style="<%=css_Img%>" align="left" />
				        </a>
				        <%
	                    hasImageDisplay = false;
					}
     				%>
					<div style="<%=css_NewsBlock_Para%>">
						<img src="<%=context_Path%>/images/bullet-dot-green.png" alt=""/>
						<a class="newsFeed" href="<%=context_Path%>/news/content.jsp?page=<%=thisPage%>&feed=<%=str_feed_id%>&newsitemid=<%=intNewsId%>&ftitle=<%=str_feed_title%>"><%=ititle%></a>
					</div>
					<%
                } catch (Exception e) {
                	log.error("WC2011-News at Index Page=",e);
                }
			} // end - for loop for items
             
         } catch (Exception e) {
             log.error("News index page", e);
         }
                    %>
                    <div id="more" class="more" style="<%=css_NewsBlock_more%>">
                        <a class="newsFeed" href="<%=context_Path%>/news/content_category.jsp?page=<%=thisPage%>&feed=<%=str_feed_id%>&ftitle=<%=str_feed_title%>">more</a>
                    </div>
                     <div class="clearFloat"></div>
                    <%
                    }else{
                        out.println("Data Not Available");
                    }
                    %>
                </div>
            </td>
        </tr>
    </table>
</div>
<div style="padding: 0px 0px 0px 3px;">
    <%@ include file="../includes/cricket_content.jspf"%>
</div>

<%@ include file="../includes/footer.jspf"%>
<%
app="WorldCup2011";
wpb.LogVisit(strIP, thisPage, strGsm,strApn,strBrand,strModel, app,request.getQueryString());
%>